<!DOCTYPE html>
<html>
<head>
    {include file="../application/common/header.html" /}
</head>

<body>
    <table id="exam_chart_studentdg">
        <thead>
            <tr>
                {volist name="list" id="vo"}
                    <th data-options="field:'{$vo}',sortable:true">{$vo}</th>
                {/volist}
            </tr>
        </thead>
    </table>
    <div id="exam_chart_studenttb">
        <form id="exam_chart_studentForm" class="m5">
            <div>
                年级：<select id="grade" name="grade" class="easyui-combobox" data-options="width:80,panelHeight:'auto',url:'/compent/Util/gradeList',onSelect:changeGrade"></select>
                班级：<select id="clazz" name="clazz" class="easyui-combobox" data-options="width:80,editable:false,onSelect:changeClazz"></select>
                <select id="studentId" name="studentId" class="easyui-combobox" data-options="width:80,editable:false"></select>
                批量学生：<input class="easyui-textbox" id="studentNames" name="studentNames">
                <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-search'" onclick="searchForm1('exam_chart_student')">查询</a>
                <a class="easyui-linkbutton" href="javascript:void(0)" data-options="iconCls:'icon-save'" onclick="outExcel1('exam_chart_student','/examScore/exam_chart_student')">导出为EXCEL</a>
                <a class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="studentChartPic(1)">历次考试排名升降图</a>
                <a class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="studentChartPic(2)">历次考试分数升降图</a>
            </div>
        </form>
    </div>
    <script type="text/javascript">
        var url = "/examScore/exam_chart_student";
        $(function(){
            initDatagrid("exam_chart_student",url);
        })  
        function studentChartPic(n){
            var xsid=$("#studentId").combobox('getValue');
            if(!xsid) return;
            if(n==1){
                window.open(url + "/rankChart?xsid="+xsid);
            }else{
                window.open(url + "/scoreChart?xsid="+xsid);
            }   
        }
        function changeGrade(record){
            var url="/compent/Util/clazzList?grade="+record.value;
            $('#clazz').combobox('setValue','');
            $('#clazz').combobox('reload',url);
            $("#studentId").combobox('setValue','');
        }
        function changeClazz(record) {
            var grade = $("#grade").combobox('getValue');
            var url="/compent/Util/studentList?grade="+grade+"&clazz="+record.value;
            $('#studentId').combobox('setValue','');
            $('#studentId').combobox('reload',url);
        }
        function searchForm1(cf) {
            var grade = $("#grade").combobox('getValue');
            if(!grade) {
                $.messager.alert('操作提示','请选择年级');
                return;
            }
            var dataGrid = $('#'+cf+'dg');
            dataGrid.datagrid('load', $.serializeObject($('#' + cf + "Form")));
        }
        function outExcel1(cf, url){
            var grade = $("#grade").combobox('getValue');
            if(!grade) {
                $.messager.alert('操作提示','请选择年级');
                return;
            }
            window.location.href = url+"/exportExcel.html?" + $('#'+cf+'Form').serialize();
        }
    </script>
</body>
</html>